FROM openjdk:8u272-jdk as builder
WORKDIR application
ARG JAR_FILE=target/reactive-application.jar
COPY ${JAR_FILE} application.jar
RUN java -Djarmode=layertools -jar application.jar extract

FROM openjdk:8u272-jdk
WORKDIR application
COPY --from=builder application/dependencies/ ./
COPY --from=builder application/snapshot-dependencies/ ./
COPY --from=builder application/spring-boot-loader/ ./
COPY --from=builder application/application/ ./
COPY docker-entrypoint.sh ./
RUN chmod +x docker-entrypoint.sh
ENTRYPOINT ["./docker-entrypoint.sh"]

# docker build -t reactive-application:1.0.0 .
# docker tag [ImageId] registry.cn-wulanchabu.aliyuncs.com/bingzhong/reactive-application:[镜像版本号]
# docker push registry.cn-wulanchabu.aliyuncs.com/bingzhong/reactive-application:[镜像版本号]